

export default class ToUtil{

    static IntToByte4(data):any[]{
        var targets:any[] = [];
        targets[0] = (data & 0xFF);
        targets[1] = (data >> 8 & 0xFF);
        targets[2] = (data >> 16 & 0xFF);
        targets[3] = (data >> 24 & 0xFF);
        return targets;
    }

    static Byte4ToInt(bytes:any[]){
        var b3 = bytes[0] & 0xFF;
        var b2 = bytes[0 + 1] & 0xFF;
        var b1 = bytes[0 + 2] & 0xFF;
        var b0 = bytes[0 + 3] & 0xFF;
        return (b0 << 24) | (b1 << 16) | (b2 << 8) | b3;
    }

}

